<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
	
<%@page import="com.lovo.bbs.vo.*,com.lovo.bbs.bo.*,java.util.*"%>



<%	
    //取得主题回帖
    String  asPostid = request.getParameter("postid");
    int postid=0;
    if(asPostid!=null&&!"".equals(asPostid)){
       postid = Integer.parseInt(asPostid);
    }
    PostVo postData = new PostBo().getPostByID(postid);  
    
	//操作类型
	String asOpType = (String)request.getParameter("opType");
	int opType = 0;
	if(!"".equals(asOpType)&&asOpType!=null){
	   opType = Integer.parseInt(asOpType);
	}
	
	String[] processMod = { "", "修改帖子", "删除帖子" };
	
	 //请求页
	String queryPages = (String)request.getParameter("queryPage");
	if(queryPages==null||"".equals(queryPages)||"0".equals(queryPages)){
	  queryPages="1";
	}
	int queryPage=Integer.parseInt(queryPages);
	
	
	String forumSelect = (String) request.getAttribute("forumSelect");
%>
<html>
	<head>
		<link href="../../../css/admin.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../../../js/wbs_admin.js"></script>
		<script type="text/javascript">
		
		 function validate(){
      	 
       	   var msg=document.getElementById("errormsg");
       	   
       	   if(trim(document.frmMain.posttopic.value)==""){            
              msg.innerHTML="<br><font color='red'>提示:请输入主题名称</font>"    
              document.frmMain.posttopic.focus();
              return false;
           }
           
           if(trim(document.frmMain.username.value)==""){            
              msg.innerHTML="<br><font color='red'>提示:请输入发表作者</font>"    
              document.frmMain.username.focus();
              return false;
           }
       	   
       	   if(trim(document.frmMain.postdate.value)==""){            
              msg.innerHTML="<br><font color='red'>提示:请输入发表时间</font>"    
              document.frmMain.postdate.focus();
              return false;
           }        
           
         return true;  
        }
		</script>
	</head>
	<body>
		<form action="PostUpdateServlet" method="post" name="frmMain" onSubmit="return validate();">
			<table class="navigation" style="width:98%" align="center">
				<tr>
					<td>
						当前位置: 帖子管理-->操作-->
						<font color="red"><%=processMod[opType - 1]%></font>
					</td>
				</tr>
			</table>
						<br>
			<table style="width:90%;" align="center">
				<div class="DialogBody">
					<div class="formArea">
						<div id="errormsg" class="DialogMsg"></div>
						<p>
							回帖名称:
							<input type="text" name="posttopic" style="width:200px" maxlength="80" value="<%=postData.getPosttitle()%>">
							(提示:名称不可以修改,1~80字符)
						<p>
							&nbsp;发表作者:
							<input type="text" name="username" style="width:200px" maxlength="20" value="<%=postData.getUsername()%>"   disabled ="disabled">
							(帖子发表的作者,不可更改)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<p>
							&nbsp;发表时间:
							<input type="text" name="postdate" style="width:200px" maxlength="30" value="<%=postData.getPostdate()%>"    disabled ="disabled">
							(帖子发表的时间,不可更改)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<p>
							<input type="submit" name="submit" class="button" value=" 确定 " onclick="validate();">
							<input type="button" name="button" class="button" value=" 取消 " onclick="preReturn();">
						<p>
							<br>
					</div>
				</div>
			</table>
			<input type="hidden" name="postid" value="<%=postData.getPostid()%>">
			<input type="hidden" name="queryPage" value="<%=queryPage%>">
			<input type="hidden" name="opType" value="<%=opType%>">
			<input type="hidden" name="topicid" value="<%=postData.getTopicid()%>">
			<input type="hidden" name="forumSelect" value="<%=forumSelect%>">
		</form>
	</body>
</html>
